{*
Template for news module
Style of Hoithanh.com
@author: Trungdt
@since: Feb 11, 2011
*}
<div class="blog">
{include file="`$smarty.const.BASE`modules/common/views/_permission_icons.tpl"}
	{if $enable_rss == true}<a class="rsslink" href="{rsslink}">{$_TR.alt_rssfeed}</a>{/if}
{if $moduletitle != ""}<h1>{$moduletitle}</h1>{/if}
	{foreach key="key" name="object" from=$news item=newsitem}
	{permissions level=$smarty.const.UILEVEL_PERMISSIONS}
	<div class="itemactions">
		{if $permissions.administrate == true || $newsitem->permissions.administrate == true}
		<a href="{link action=userperms int=$newsitem->id _common=1}"><img src="{$smarty.const.ICON_RELATIVE}userperms.png" title="{$_TR.alt_userperm_one}" alt="{$_TR.alt_userperm_one}" {$smarty.const.XHTML_CLOSING}></a>&nbsp;
		<a href="{link action=groupperms int=$newsitem->id _common=1}"><img src="{$smarty.const.ICON_RELATIVE}groupperms.png" title="{$_TR.alt_groupperm_one}" alt="{$_TR.alt_groupperm_one}" {$smarty.const.XHTML_CLOSING}></a>
		{/if}
		{if $permissions.edit_item == true || $newsitem->permissions.edit_item == true}
		{if $newsitem->approved == 2} {* in ap *}
		<img src="{$smarty.const.ICON_RELATIVE}edit.disabled.png" title="{$_TR.alt_edit_disabled}" alt="{$_TR.alt_edit_disabled}" {$smarty.const.XHTML_CLOSING}>
		{else}
		<a href="{link action=edit id=$newsitem->id}"><img src="{$smarty.const.ICON_RELATIVE}edit.png" title="{$_TR.alt_edit}" alt="{$_TR.alt_edit}" {$smarty.const.XHTML_CLOSING}></a>
		{/if}
		{/if}
		{if $permissions.delete_item == true || $newsitem->permissions.delete_item == true}
		{if $newsitem->approved == 2} {* in ap *}
		<img src="{$smarty.const.ICON_RELATIVE}delete.disabled.png" title="{$_TR.alt_delete_disabled}" alt="{$_TR.alt_delete_disabled}" {$smarty.const.XHTML_CLOSING}>
		{else}
		<a onclick="return confirm('{$_TR.delete_confirm}');" href="{link action=delete id=$newsitem->id}"><img src="{$smarty.const.ICON_RELATIVE}delete.png" title="{$_TR.alt_delete}" alt="{$_TR.alt_delete}" {$smarty.const.XHTML_CLOSING}></a>
		{/if}
		{/if}
		{if $permissions.manage_approval == 1}
		<a class="managerevisions" href="{link module=workflow datatype=newsitem m=newsmodule s=$__loc->src action=revisions_view id=$newsitem->id}" title="{$_TR.alt_revisions}">
			<img src="{$smarty.const.ICON_RELATIVE}revisions.png" alt="{$_TR.revisions}" {$smarty.const.XHTML_CLOSING}>
		</a>
		{/if}
	</div>
	{/permissions}
	<div class="article_row">
		<div class="article_column column1 cols1">
			<img height="105" width="130" class="article-thumbnail" src="{$smarty.const.BASE_URL}/phpThumb.php?src={$newsitem->image}&w=130&h=105"><h2 class="contentheading">
				<a class="contentpagetitle" href="{if $newsitem->isRss}{$newsitem->rss_link}{else}/news/{$newsitem->internal_name}{/if}">{$newsitem->title}</a>
				<span class="createdate">[{$newsitem->datetime}]</span>
			</h2>
			<p class="iteminfo">
			</p>
			<p style="text-align: justify;">
				{if $newsitem->summary != ""}
				<div>{$newsitem->summary}</div>
			{else}
				<div>{$newsitem->body|summarize:"html":"para"}</div>
				{/if}
			</p>
			<div align=right><img src="{$smarty.const.THEME_RELATIVE}images/bullet-r.gif" border=0 class="news_readmore"><a id="news_more_{$newsitem->id}" href="{if $newsitem->isRss}{$newsitem->rss_link}{else}{link action=view id=$newsitem->internal_name}{/if}" {if $newsitem->isRss}{$newsitem->rss_link}{else}{link action=view id=$newsitem->internal_name}{/if}>{$_TR.read_more}</a>&nbsp;&nbsp;&nbsp;</div>
		</div>
		<div class="clear"></div>
	</div>
	{foreachelse}
		<div>{$_TR.no_news}</div>
	{/foreach}
</div>

{permissions level=$smarty.const.UILEVEL_NORMAL}
	{if $morenews == 1 || $permissions.add_item == true || ($in_approval > 0 && $canview_approval_link == 1) || $permissions.view_unpublished == 1}
	<div class="moduleactions">
		{*
		{if $morenews == 1}
		<a class="viewmorenews" href="{link action=view_all_news}">{$_TR.view_all}</a>{br}
		{/if}
		*}
		{permissions level=$smarty.const.UILEVEL_NORMAL}
		{if $permissions.add_item == true}
		<a class="addnews" href="{link action=edit}">{$_TR.create_news}</a>{br}
		{/if}
		{if $in_approval > 0 && $canview_approval_link == 1}
		<a class="approvenews" href="{link module=workflow datatype=newsitem m=newsmodule s=$__loc->src action=summary}">{$_TR.view_approval}</a>{br}
		{/if}
		{if $permissions.view_unpublished == 1 }
		<a class="expirednews" href="{link action=view_expired}">{$_TR.view_expired}</a>{br}
		{/if}
		{/permissions}
	</div>
	{/if}
{/permissions}
{paging current_page=$page pages=$pages action=view_page module=newsmodule page_length=4 src=$__loc->src}
